#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	int a, b;
	scanf("%d %d", &a, &b);
	int i = a;
	int sum = 0;
	int flag = 0;
	int judge = 4;
	/*printf("    ");*/
	for (i=a;i<b;i++)
	{
		sum += i;
	
		printf("%5d", i);
		/*if (judge--)
		{
			printf("  ");
		}*/
		flag++;
		if (flag == 5)
		{
			printf("%c", '\n');
			/*printf("    ");*/
			judge = 5;
			flag = 0;
		}
	}
	printf("%5d", b);
	sum += b;
	printf("\n");
	printf("Sum = %d", sum);
	return 0;
}